package com.westcom.healthmate.dao;

import com.westcom.healthmate.po.MiraSleepDataPo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface MiraSleepDataDao extends JpaRepository<MiraSleepDataPo,Long>
{
    @Query("select d from MiraSleepDataPo d where d.mac=:mac and d.sensorId=:sensorId and d.time>:st and d.time<:et")
    List<MiraSleepDataPo> getSleepDataByTimeSection(@Param("mac") String mac, @Param("sensorId")int sensorId,@Param("st") long st, @Param("et") long et);
}
